package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TbRoomInfoMapper;
import com.ruoyi.system.domain.TbRoomInfo;
import com.ruoyi.system.service.ITbRoomInfoService;

/**
 * 房间详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-11
 */
@Service
public class TbRoomInfoServiceImpl implements ITbRoomInfoService 
{
    @Autowired
    private TbRoomInfoMapper tbRoomInfoMapper;

    /**
     * 查询房间详情
     * 
     * @param roomId 房间详情主键
     * @return 房间详情
     */
    @Override
    public TbRoomInfo selectTbRoomInfoByRoomId(Long roomId)
    {
        return tbRoomInfoMapper.selectTbRoomInfoByRoomId(roomId);
    }

    /**
     * 查询房间详情列表
     * 
     * @param tbRoomInfo 房间详情
     * @return 房间详情
     */
    @Override
    public List<TbRoomInfo> selectTbRoomInfoList(TbRoomInfo tbRoomInfo)
    {
        return tbRoomInfoMapper.selectTbRoomInfoList(tbRoomInfo);
    }

    /**
     * 新增房间详情
     * 
     * @param tbRoomInfo 房间详情
     * @return 结果
     */
    @Override
    public int insertTbRoomInfo(TbRoomInfo tbRoomInfo)
    {
        tbRoomInfo.setCreateTime(DateUtils.getNowDate());
        return tbRoomInfoMapper.insertTbRoomInfo(tbRoomInfo);
    }

    /**
     * 修改房间详情
     * 
     * @param tbRoomInfo 房间详情
     * @return 结果
     */
    @Override
    public int updateTbRoomInfo(TbRoomInfo tbRoomInfo)
    {
        tbRoomInfo.setUpdateTime(DateUtils.getNowDate());
        return tbRoomInfoMapper.updateTbRoomInfo(tbRoomInfo);
    }

    /**
     * 批量删除房间详情
     * 
     * @param roomIds 需要删除的房间详情主键
     * @return 结果
     */
    @Override
    public int deleteTbRoomInfoByRoomIds(Long[] roomIds)
    {
        return tbRoomInfoMapper.deleteTbRoomInfoByRoomIds(roomIds);
    }

    /**
     * 删除房间详情信息
     * 
     * @param roomId 房间详情主键
     * @return 结果
     */
    @Override
    public int deleteTbRoomInfoByRoomId(Long roomId)
    {
        return tbRoomInfoMapper.deleteTbRoomInfoByRoomId(roomId);
    }
}
